<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>短信发送页面</title>
    <meta name="decorator" content="default"/>
    <script src="${ctxStatic}/layer/layer.js"></script>
    <script src="${ctxStatic}/js/widget/stickytableheaders/js/jquery.stickytableheaders.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            var selectId=$("#bank_select").val();
            var loanId=$("#loanId").val()||"";
            $.ajax({
                type : "POST",  //提交方式
                url : "${ctx}/sys/member/member/getLoanByBankId",//路径
                data : {"bankId":selectId},//数据，这里使用的是Json格式进行传输
                success : function(data) {//返回数据根据结果进行相应的处理
                    $("#loan_select").html("");
                    if(data){

                        for(var i = 0; i < data.length; i++){
                            var loan=data[i];
                            if(loanId==loan.id){
                                $("#loan_select").append('<option selected="selected" value="'+loan.id+'">'+loan.name+'</option>')
                            }
                            else{
                                $("#loan_select").append('<option value="'+loan.id+'" >'+loan.name+'</option>')
                            }
                        }
                    }else{
                        $("#loan_select").html("<option selected='selected'>暂无数据</option>");
                    }
                    $("#loan_select").val(loanId).trigger("change");
                }
            });
            $(".view_service_record").click(function(){
                var id=$(this).data("id");
                parent.layer.open({
                    type: 2,
                    title: '服务记录',
                    shadeClose: true,
                    shade: 0,
                    area: ['90%', '70%'],
                    content: '${ctx}/sys/member/member/seviceRecordPage?id='+id //iframe的url
                });
            });
            //查看客户信息
            $(".view-info").click(function(){
                var id=$(this).data("id");
                layer.open({
                    type: 2,
                    title:"客户信息",
                    skin: 'layui-layer-rim', //加上边框
                    offset: ['50px', '100px'],
                    area: ['900px', '500px'], //宽高
                    content: "${ctx}/sys/member/member/load/viewMemberInfoPage?id="+id
                });
            });
            $("#contentTable").stickyTableHeaders();
            $("body").on("change","#bank_select",function () {
                var selectId=$("#bank_select").val();
                var loanId=$("#loanId").val();
                $.ajax({
                    type : "POST",  //提交方式
                    url : "${ctx}/sys/member/member/getLoanByBankId",//路径
                    data : {"bankId":selectId},//数据，这里使用的是Json格式进行传输
                    success : function(data) {//返回数据根据结果进行相应的处理
                        $("#loan_select").html("");
                        if(data){
                            for(var i = 0; i < data.length; i++){
                                var loan=data[i];
//                                if(i==0){
                                if(loanId ==loan.id ){
                                    $("#loan_select").append('<option selected="selected" value="'+loan.id+'">'+loan.name+'</option>')
                                }else{
                                    $("#loan_select").append('<option value="'+loan.id+'" >'+loan.name+'</option>')
                                }
                            }
                        }else{
                            $("#loan_select").html("<option selected='selected'>暂无数据</option>");
                        }
                        $("#loan_select").val("").trigger("change");
                    }
                });
            });
        });

        function page(n,s){
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }

    </script>


</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/member/member/">用户信息列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="loan" action="${ctx}/sys/member/member/memberloan" method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <%--<input type="hidden" id="loanId" value="${loanId}" />--%>
    <%--<label class="label-title">渠道银行：</label>--%>
    <%--<select id="bank_select"  name="bankId" style="min-width: 111px">--%>
        <%--<option value="">==请选择==</option>--%>
        <%--<c:forEach items="${banks}" var="bank">--%>
            <%--<option value="${bank.id}" <c:if test="${bankId==bank.id}">selected="selected"</c:if>   >${bank.name}</option>--%>
        <%--</c:forEach>--%>
    <%--</select>--%>
    <%--<label class="label-title" style="width: 80px;">贷款产品：</label>--%>
    <%--<select id="loan_select" name="loanId" style="min-width: 111px">--%>
        <%--<option value="">==请选择==</option>--%>
    <%--</select>--%>

    <%--<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>--%>
    <%--<li class="clearfix"></li>--%>
    <%--</ul>--%>
</form:form>
<%--<form:form id="searchForm" modelAttribute="member" action="${ctx}/sys/member/member/" method="post" class="breadcrumb form-search">--%>
<%--<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>--%>
<%--<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>--%>
<%--<ul class="ul-form">--%>
<%--<li><label>电话：</label>--%>
<%--<form:input path="username" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
<%--</li>--%>
<%--<li><label>身份证号码：</label>--%>
<%--<form:input path="idCard" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
<%--</li>--%>
<%--<li><label>真实姓名：</label>--%>
<%--<form:input path="realname" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
<%--</li>--%>
<%--<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>--%>
<%--<li class="clearfix"></li>--%>
<%--</ul>--%>
<%--</form:form>--%>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead style="top: 0">
    <tr>
        <th style="width: 5%">信息标题</th>
        <th style="width: 5%">信息模板</th>
        <th style="width: 5%">信息内容</th>
        <th style="width:5%">接受人员</th>
        <th style="width: 10%">操作</th>
    </tr>
    </thead>
    <tbody >
    <c:forEach items="${page.list}" var="member">
        <tr>
            <td style="width: 5%">
                <%--<a href="#" href="javascript:void(0)" class="view-info"   data-id="${member.id}">--%>
                    <form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
                <%--</a>--%>
            </td>
            <td style="width: 5%">
                <select id="bank_select"  name="bankId" style="min-width: 111px">--%>
                        <option value="">==请选择==</option>
                        <c:forEach items="${banks}" var="bank">
                        <option value="${bank.id}" <c:if test="${bankId==bank.id}">selected="selected"</c:if>   >${bank.name}</option>
                        </c:forEach>
                        </select>
            </td>
            <td style="width: 5%">
                <form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
            </td>
            <td style="width: 5%">
                    ${member.managerName}
            </td>
            <td style="width: 5%">
                <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="发送"/></li>
            </td>

                <%--		<td style="width: 5%">
                            <fmt:formatDate value="${member.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td style="width: 5%">
                            ${member.remarks}
                        </td>--%>
                <%--<td style="width: 10%">--%>
                <%--<shiro:hasPermission name="sys:member:member:edit">	<a href="${ctx}/sys/member/member/form?id=${member.id}">修改</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:bankcardmanager"><a href="${ctx}/sys/member/member/bankcardList?id=${member.id}">银行卡管理</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:uploadmaterial">	<a  href="${ctx}/sys/member/member/uploadPage?id=${member.id}">上传资料</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:downloadmaterial"><a href="${ctx}/sys/member/member/downLoadMaterials?id=${member.id}" onclick="return confirmx('确认要下载该用户的资料吗？', this.href)">下载资料</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:inputapply"><a  href="${ctx}/sys/member/member/inputApplyPage?id=${member.id}">客户录单</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:applymaterial"><a  href="${ctx}/sys/member/member/checkFormPage?id=${member.id}">审核资料</a></shiro:hasPermission>--%>
                <%--<shiro:hasPermission name="sys:member:member:edit"><a href="${ctx}/sys/member/member/delete?id=${member.id}" onclick="return confirmx('确认要删除该用户信息吗？', this.href)">删除</a></shiro:hasPermission>--%>
                <%--</td>--%>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>

</body>
</html>